package com.xiong.springcloud.service;

import com.xiong.springcloud.entities.Payment;
import com.xiong.springcloud.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author wardseptember
 * @create 2020-03-31 14:41
 */
@Component
@FeignClient("CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {

    /**
     * 这里注意，接口返回结果和注解必须和8001、8002controller对应起来
     * @param id
     * @return
     */
    @GetMapping("/payment/get/{id}")
    public Result<Payment> getPaymentById(@PathVariable("id") Long id);

    @GetMapping("/payment/feign/timeout")
    public String paymentFeignTimeout();
}
